<template>
  <div class="bottom-bar">
    <div class="bar-item">
      <div class="left">
        <div class="service"></div>
        <span class="service-text">客服</span>
      </div>
      <div class="left">
        <div class="shop"></div>
        <span class="shop-text">店铺</span>
      </div>
      <div class="left">
        <div class="collect"></div>
        <span class="collect-text">收藏</span>
      </div>
    </div>
    <div class="bar-item center">
      <div class="left yellow" @click="addCart">加入购物车</div>
      <div class="left buy">购买</div>
    </div>
  </div>
</template>

<script>
export default {
  name: "DetailBottomBar",
  methods: {
    addCart() {
      this.$emit("addCart");
    },
  },
};
</script>

<style>
.bottom-bar {
  height: 56px;
  position: fixed;
  right: 0;
  left: 0;
  bottom: 0;
  background-color: #fff;
  display: flex;
  z-index: 50;
}

.bar-item {
  flex: 1;
  display: flex;
}
.left {
  float: left;
  flex: 1;
}
.service {
  width: 50px;
  height: 36px;
  margin-left: 10px;
  background: url("../../../assets/img/detail/detail_bottom.png") no-repeat 5px -80px/70%;
}
.service-text {
  display: inline-block;
  margin-left: 15px;
}
.shop {
  width: 50px;
  height: 36px;
  margin-left: 10px;
  background: url("../../../assets/img/detail/detail_bottom.png") no-repeat 5px -152px/70%;
}
.shop-text {
  margin-left: 15px;
}
.collect {
  width: 50px;
  height: 36px;
  margin-left: 5px;
  background: url("../../../assets/img/detail/detail_bottom.png") no-repeat 5px
    5px/70%;
}
.collect-text {
  margin-left: 10px;
}
.center {
  line-height: 52px;
  text-align: center;
}
.yellow {
  background-color: yellow;
  color: rgb(61, 60, 60);
  font-size: 18px;
}
.buy {
  background-color: #ff5777;
  color: #fff;
  font-size: 18px;
}
.text {
  text-align: center;
}
</style>